package cn.wolfcode.rbac.query;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class QueryObject {
    //请求对象类,接收用户前台发送过来的请求参数
    //1.当前页
    private int currentPage = 1;
    //2.每页的显示多少条
    private int pageSize = 5;

    //select * from department limit 0,5   //从索引为 0 的数据开始显示,每页显示5条数据
    //定义一个方法,用来返回每页第一条数据所对应的索引
    public int getStart(){
        return (currentPage-1)*pageSize;
    }

}
